/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author GustavoKatel_
 */
public class os {
    
    public static String name(){
        String sis = System.getProperty("os.name");
        String sname = "";
        if(sis.toLowerCase().contains("windows")){
            sname = "Windows";
        } else if(sis.toLowerCase().contains("linux")||sis.toLowerCase().contains("nix")){
            sname = "Linux";
        }else if(sis.toLowerCase().contains("macosx")){
            sname = "MacOs X";
        }
        return sname;
    }
    
    public static void exec(String arg){
        String line = "";
        if(name().equals("Windows") )
            line = arg;
        else
            line = arg;
        try {
            Runtime.getRuntime().exec(line);
        } catch (IOException ex) {
            System.out.println(ex.getMessage());
        }
    }
}
